<!--
 * @Description: 
 * @Author: Sun
 * @Date: 2019-08-14 21:45:35
 * @LastEditors: Sun
 * @LastEditTime: 2019-08-14 21:57:49
 -->
<template>
  <div>
      <h1>姓名：{{info.name}}</h1>
      <h2>年龄：{{info.age}}</h2>
      <h2>兴趣：{{info.interest}}</h2>
  </div>
</template>
<script>
import axios from 'axios'
export default {
  data(){
     return {
         name:'hello World',
     }
  },
  // asyncData(){
  //     return axios.get('https://api.myjson.com/bins/8gdmr')
  //     .then((res)=>{
  //         console.log(res)
  //         return {info:res.data}
  //     })
      
  // }

    async asyncData(){
      let {data}=await axios.get('https://api.myjson.com/bins/8gdmr')
      return {info: data}
      
  }
}
</script>